package com.deng.common;

import java.io.FileInputStream;
import java.io.InputStream;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

public class ExcelImport {

	private final static String filepath = "c:/1.xls";
	private final static String sec1 = "insert into UNIT_PRICE_ITEM_INCOME_VS_ORGANIZATION(organization_id,item_id,point,is_important,duty_id) values(";
	
	
	
	private final static String deptId = "85";//科室ID
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		fileRead();
	}
	
	public static void fileRead(){
		try{
			InputStream is = new FileInputStream(filepath); 
			Workbook wb = Workbook.getWorkbook(is); 
			Sheet sheet = wb.getSheet(0); 
			for(int i = 0;i<sheet.getRows();i++){
				Cell c1 = sheet.getCell(0, i);
				String itemId = c1.getContents();
				Cell c2 = sheet.getCell(1, i);
				String point = c2.getContents();
				System.out.println(sec1+deptId+",'"+itemId+"',"+point+",1,2)");
			}
			
			
		}catch(Exception ex){
			ex.printStackTrace();
		}
		
 
	}
}
